package com.iceberg.service.impl.customer;

import java.util.List;

import com.iceberg.dao.customer.CustomerDAO;
import com.iceberg.model.customer.Customer;
import com.iceberg.service.customer.CustomerService;

public class CustomerServiceImpl implements CustomerService {
  CustomerDAO customerDAO;
  //DI via Spring
  public void setCustomerDAO(CustomerDAO customerDAO) {
    this.customerDAO = customerDAO;
  }
 
  //call DAO to save customer
  public void addCustomer(Customer customer){
    customerDAO.addCustomer(customer);
  }
 
  //call DAO to return customers
  public List<Customer> listCustomer(){
    return customerDAO.listCustomer();
  }
}
